Skip to content

Standardize flag shorthands across all commands#76

Merged
telegrapher merged 7 commits into
fix/dcr-use-ims-urlfrom
fix/consistent-flag-shorthands
Feb 27, 2026
Merged

Standardize flag shorthands across all commands#76
telegrapher merged 7 commits into
fix/dcr-use-ims-urlfrom
fix/consistent-flag-shorthands

Conversation

@telegrapher

Copy link
Copy Markdown
Collaborator

Summary

Resolve inconsistent flag shorthands where -s and -a meant different things in different commands.

Standardized lowercase shorthands:

  • -p always means --clientSecret (was -s in authz jwt and invalidate serviceToken)
  • -s always means --scopes (no longer overloaded)
  • -a always means --*ApiVersion (no longer overloaded)

New shorthands for displaced flags:

  • -A for --account (authz jwt)
  • -x for --authorizationCode (authz service)
  • -C for --cascading (invalidate refresh/device)
  • -A for --authSrc (admin profile/organizations)

telegrapher and others added 4 commits February 27, 2026 16:07
- -p always means --clientSecret (was -s in authz jwt and invalidate serviceToken)
- -s always means --scopes (no longer overloaded)
- -a always means --*ApiVersion (no longer overloaded)
- --account gets -A, --authorizationCode gets -x, --cascading gets -C, --authSrc gets -A
Remove PKCE field from Config — it was not user configuration but a
command-level decision. The pkce command now calls AuthorizeUserPKCE()
directly instead of mutating the shared Config pointer.
…ON, URL slash

- Zero private key bytes after use in JWT exchange to prevent key material
  lingering in memory until GC (6.1.7)
- Add port validation to validateAuthorizeUserConfig, remove defaultPort
  fallback so the ims package validates its own parameters (N10)
- Replace map[string]interface{} with anonymous struct in refresh command
  for deterministic JSON field order and better performance (N11)
- Trim trailing slash from IMS URL before building JWT claim keys to
  prevent double-slash in metascope URIs (6.2.10)
- Standardize orgs API version error message to match profile style (6.2.12)
- Document PersistentPreRunE override risk in README.md (N7)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The Expires field was set in jwt_exchange.go, exchange.go, and refresh.go
but never read by any caller. The calculations were also wrong:
duration * duration produces nanoseconds-squared (overflow), and
refresh.go used time.Second while the others used time.Millisecond.

Remove the field entirely rather than fixing dead code.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Remove dead TokenInfo.Expires field and broken calculations
Miscellaneous hardening: key zeroing, port validation, struct JSON
Split AuthorizeUser into AuthorizeUser and AuthorizeUserPKCE
@telegrapher
telegrapher merged commit 3b31327 into fix/dcr-use-ims-url Feb 27, 2026
2 checks passed
@telegrapher
telegrapher deleted the fix/consistent-flag-shorthands branch February 28, 2026 13:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants